package com.mlethe.android.demo.recyclerview.adapter.callback;

import android.view.View;

import com.mlethe.demo.recyclerview.adapter.R;
import com.mlethe.library.recyclerview.callback.AbstractLoadCallback;

public class FooterLoadCallback extends AbstractLoadCallback {

    @Override
    public int getLayoutId() {
        return R.layout.default_loading_footer;
    }

    @Override
    public void onLoading() {
        setVisibility(R.id.progressBar, View.VISIBLE)
                .setText(R.id.recycler_foot_more, R.string.loading);
    }

    @Override
    public void onLoaded() {
        setVisibility(R.id.progressBar, View.GONE)
                .setText(R.id.recycler_foot_more, R.string.recycler_footer_load_end);
    }

    @Override
    public void onLoadFail() {
        setVisibility(R.id.progressBar, View.GONE)
                .setText(R.id.recycler_foot_more, R.string.recycler_footer_network_error);
    }

    @Override
    public void onNoData() {
        setVisibility(R.id.progressBar, View.GONE)
                .setText(R.id.recycler_foot_more, R.string.recycler_footer_end);
    }
}
